<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<%
String logprior = (String)session.getAttribute("logprior");
if(logprior==null){response.sendRedirect("logfail.jsp");}
%>
<body>
<form name="Frm" method="post" action="studentSerlvet" onsubmit="return nocheck()" target="main">
<table>
<tr><td>學生編號:<input type="text" name="no" size=8 maxlength=8 onKeyPress="KeyPress()" ></td>
<td><input type="submit" value="新增" class=btn size=10></td>
<td><input type="submit" value="查詢" class=btn size=10></td></tr>
</table>
</form>
</body>

<script language=javascript>
function getfocus() {
     document.Frm.elements(0).focus();
}

function KeyPress() 
{
if (window.event.keyCode == 13)
window.event.keyCode =0;
} 

function check()
{
       	if (document.Frm.no.value == "")
	{
		alert("請輸入學生編號!") ;
   		document.Frm.no.focus() ;
   		return false ;
   	}  
  return true;
}
</script>


</html>

